/*
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include <iostream>

#define ENABLE_ASSERTIONS 1

#ifdef _MSC_VER
#define DEBUG_BREAK __debugbreak()
#else
#define DEBUG_BREAK exit(0)
#endif

#if ENABLE_ASSERTIONS
#define vAssert(condition)\
{\
	if (!(condition))\
	{\
		std::cout << "assertion failed: " << #condition << " (called from \"" << __FILE__ << "\", line " << __LINE__ << ")" << std::endl;\
		DEBUG_BREAK; \
	}\
}

#define assert(condition)\
{\
	if (!(condition))\
	{\
		std::cout << "assertion failed: " << #condition << " (called from \"" << __FILE__ << "\", line " << __LINE__ << ")" << std::endl;\
		/*exit(0);*/\
	}\
}

#else
#define vAssert(condition) 
#define assert(condition) 
#endif



namespace Ogre
{
	typedef float Real;
}

typedef unsigned char Exponent;
typedef unsigned int MaterialID;

#define DEFAULT_MATERIAL (MaterialID)-1

//thread local storage attribute
#define vTLS __declspec( thread )

#ifdef __GNUG__
//unset MSVC optimization flags
#define __forceinline
#define override
//redefine thread local storage attribute
#undef vTLS
#define vTLS __thread
#endif
